

// import SynchronizationLoginNork from "@/utils/SynchronizationLoginNork"

import SynchronizationLoginNork from '@/utils/SynchronizationLoginWork'
import Synchronization from "@/utils/Synchronization"
// 大类
export interface LargeClassDataInterface{
    typeNo: string,
    typeName: string,
    levelCode: string,
    parentLevel: null,
    oldLevel: number,
    children: LargeClassDataInterface[]
}

export const LargeClassData = () => {
    return Synchronization.get<any,LargeClassDataInterface[]>('/MaterialManagement/getAssortList')
}

// 材料属性
export interface  materialAttributeParms{
    typeNo:string,
    typeNo2:string,
    typeNo3:string
}

export interface materialAttributeInterface{
    mtlProperty: string,
    propertyNeed: string,
    propertySeq: number,
    mtlNoNeed: string
}

export const materialAttribute = (parms:materialAttributeParms) => {
    return Synchronization.post<any,materialAttributeInterface[]>('/MaterialManagement/getTypeDetail',parms)
}

// 材料属性定义
export interface MaterialPropertyDefinitionInterface{
    mtlProperty: string,
    seqNo: number
}

export const MaterialPropertyDefinition = () => {
    return Synchronization.get<any,MaterialPropertyDefinitionInterface[]>('/MaterialManagement/getMaterialPropertiesList')
}

// 材料属性关联规格
export interface WideDefinitionInterface{
    mtlSeq: string,
    mtlSpec:string,
    sortNo: null
}

export const MaterialPropertyAssociation = (mtlProperty:string) => {
    return Synchronization.get<any,WideDefinitionInterface[]>(`/MaterialManagement/getMaterialPropertiesSpecsList?mtlProperty=${mtlProperty}`)
}

// 宽幅定义
export interface WideDefinitionInterfaceLct{
    mtlSeq: string,
    mtlSpec: string,
    sortNo: null
}

export const WideDefinition = () => {
    return Synchronization.get<any,WideDefinitionInterface[]>('/MaterialManagement/getWideDefinitionList')
}

// 单位定义
export interface  UnitDefinitionInterface{
    mtlUnit: string,
    mtlSeq: string,
    engMtlUnit: null,
    sortNo: null
}

export const UnitDefinition = () => {
    return Synchronization.get<any,UnitDefinitionInterface[]>('/MaterialManagement/getUnitList')
}

// 贴合加工方式定义
export interface FitProcessingMethodInterface{
    seqNo: null | string,
    prdType: string,
    sortNo: null | string,
    change:string
}

export const FitProcessingMethod = () => {
    return Synchronization.get<any,FitProcessingMethodInterface[]>('/MaterialManagement/getFitList')
}

// 贴合加工方式定义添加
export interface FitProcessingAddParms{
    prdType:string,
    seqNo:string,
    sortNo:string,
    sysDate:string,
    sysUser:string
}

export interface dataList{
    code:number,
    message:string,
    data:null
}

export const FitProcessingAdd = (parms:FitProcessingAddParms) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getFitAdd',parms)
}

// 单位定义添加
export interface UnitDefinitionAdditionParms{
    engMtlUnit:string,
    mtlSeq:string,
    mtlUnit:string,
    sortNo:string,
}

export const UnitDefinitionAddition = (parms:UnitDefinitionAdditionParms) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getUnitAdd',parms)
}

// 宽幅定义添加
export interface WideDefinitionAddInterface{
    mtlSeq:string,
    mtlSpec:string,
    sortNo:string,
}

export const WideDefinitionAdd = (parms:WideDefinitionAddInterface) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getWideDefinitionAdd',parms)
}

// 材料属性关联规格添加
export interface MaterialPropertiesAssociatedSpecificationsAddedInterface{
    mtlProperty:string,
    mtlSeq:string,
    mtlSpec:string,
    sortNo:string,
}

export const MaterialPropertiesAssociatedSpecificationsAdded = (parms:MaterialPropertiesAssociatedSpecificationsAddedInterface) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getMaterialPropertiesSpecAdd',parms)
}

// 材料属性定义添加
export interface materialAttributeInterfaceLc{
    mtlProperty:string,
    seqNo:string,
}

export const materialAttributeMethods = (parms:materialAttributeInterfaceLc) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getMaterialPropertiesAdd',parms)
}

// 材料属性添加
export interface materialAddInterface{
    mtlNoNeed:string,
    mtlProperty:string,
    propertyNeed:string,
    propertySeq:string,
    seqNo:string,

    typeName:string,
    typeName2:string,
    typeName3:string,
    typeNo:string,
    typeNo2:string,
    typeNo3:string
}

export const materialAdd = (parms:materialAddInterface) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getTypeDetailAdd',parms)
}

// 贴合加工方式定义删除
export const FitProcessingDelete = (prdType:string) => {
    return SynchronizationLoginNork.post<any, dataList>(`/MaterialManagement/getFitDel?prdType=${prdType}`);      
}

// 单位定义删除
export const  UnitDefinitionAdditionDelete = (mtlUnit:string) => {
    return SynchronizationLoginNork.post<any, dataList>(`/MaterialManagement/getUnitDel?mtlUnit=${mtlUnit}`);      
}

// 材料属性定义删除
export const  MaterialPropertiesAssociatedSpecificationsDelete = (mtlProperty:string) => {
    return SynchronizationLoginNork.get<any, dataList>(`/MaterialManagement/getMaterialPropertiesDel?mtlProperty=${mtlProperty}`);      
}

// 宽幅定义删除
export const WideDefinitionDelete = (mtlUnit:string) => {
    return SynchronizationLoginNork.post<any, dataList>(`/MaterialManagement/getWideDefinitionDel?mtlUnit=${mtlUnit}`)
}

// 材料属性关联规格删除
export const MaterialPropertyAssociationDelete = (mtlProperty:string,mtlSpec:string) => {
    return SynchronizationLoginNork.post<any, dataList>(`/MaterialManagement/getMaterialPropertiesSpecDel?mtlProperty=${mtlProperty}&mtlSpec=${mtlSpec}`)
}

// 材料属性删除
export interface materialAttributeDeleteParms{
    mtlNoNeed:string,
    mtlProperty:string,
    propertyNeed:string,
    propertySeq:string,
    seqNo:string,
    typeName:string,
    typeName2:string,
    typeName3:string,
    typeNo:string,
    typeNo2:string,
    typeNo3:string
}

export const materialAttributeDelete = (parms:materialAttributeDeleteParms) => {
    return SynchronizationLoginNork.post<any,dataList>('/MaterialManagement/getTypeDetailDel',parms)
}